package com.small.sentinel;

import com.small.sentinel.node.Node;
import com.small.sentinel.slotchain.ResourceWrapper;

/**
 * 入口许可
 */
public abstract class Entry {

    /**
     * 当前节点
     */
    private Node curNode;

    /**
     * 资源包装器
     */
    protected final ResourceWrapper resourceWrapper;

    /**
     * 创建时间
     */
    private final long createTimestamp;

    public abstract Node getLastNode();

    public Entry(ResourceWrapper resourceWrapper) {
        this.resourceWrapper = resourceWrapper;
        this.createTimestamp = System.currentTimeMillis();
    }

    public Node getCurNode() {
        return curNode;
    }

    public long getCreateTimestamp() {
        return createTimestamp;
    }

    public void setCurNode(Node curNode) {
        this.curNode = curNode;
    }
}
